<%-- 
    Document   : V_ListReq
    Created on : 07-nov-2013, 23:30:27
    Author     : JoseHernanQC
--%>
<%@page import="com.upao.util.BDRequerimiento"%>
<%@page import="com.google.appengine.api.datastore.Entity"%>
<%@page import="com.upao.ocw.Requerimiento"%>
<%@page import="java.util.*"%>
<%
    List<Entity> projects =  (List<Entity>)request.getAttribute("listRequerimientos");  
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>UpaoCommons Plataform</title>

        <link href="../../dist/css/bootstrap.css" rel="stylesheet">
        <link href="css/jumbotron.css" rel="stylesheet">
        
        <script src="../media/js/jquery.js" type="text/javascript"></script>
        <script src="../media/js/jquery.dataTables.js" type="text/javascript"></script>
        <script src="../js/js_menu.js" type="text/javascript"></script>

        <style type="text/css">
            @import "../media/css/demo_table_jui.css";
            @import "../media/themes/smoothness/jquery-ui-1.8.4.custom.css";
            @import "../css/menu_blanco.css";

        </style>
    </head>
    <body>
        <%
        String nombres = "JOSE";
        %>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="../index.jsp">UPAO COMMONS</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="index.jsp">Inicio</a></li>
                        <li><a href="JSP/DashBoard.jsp">Nosotros</a></li>
                        <li><a href="#contact">Contacto</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Servicios <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li class="divider"></li>
                                <li class="dropdown-header">Nav header</li>
                                <li><a href="#">Separated link</a></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
                    </ul>
                    <form class="navbar-form navbar-right" method="post" action="/user">
                        <div class="form-group">
                            <input type="text" readonly="" placeholder="Correo" value="Bienvenido(a): <%=nombres%>" class="form-control"/>
                        </div>
                        <input type="hidden" name="action" value="logOutUser"/>
                        <button type="submit" class="btn btn-success">Cerrar Sesión</button>
                    </form>
                </div><!--/.navbar-collapse -->
            </div>
        </div>
        <br/>
        <br/>
        <div style="width: 100%;">
            <div style="float: left; margin-left: 100px; width: 150px; margin-right: 20px" >
                <ul class="nav nav-pills nav-stacked">
                    <li><a href="V_ListadoProductos.jsp">Inicio</a></li>
                    <li><a href="V_ListadoProductos.jsp">Productos</a></li>
                    <li class="active"><a href="V_ListReq.jsp">Requerimientos</a></li>
                </ul>
            </div>
            
        <div  style="float: left; width: 800px; margin: auto" >
            
            
            <legend>Listado de Requerimientos</legend>
            <a style="margin-bottom: 8px; float: right" class="btn btn-success" href="Requerimientos/V_NuevoRequerimiento.jsp">Nuevo Requerimiento</a>
            
            <div id="tablatext">
            <table border="0" id="datatables" class="display">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>REQUERIMIENTO</th>
                        <th>FECHA DE REGISTRO</th>
                        <th>PRIORIDAD</th>
                        <th>ESTADO</th>
                        <th>DESCRIPCION</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody style="font-family:sans-serif; font-size: 15px">
                    <%
                    for(int idx = 0; idx < projects.size(); idx++)
                    {
                        Entity p = (Entity) projects.get(idx);
                        String action = "/TutorialServlet?action=";
                        String delete = action+"delete"+"&id="+p.getKey().getId();
                        String update = action+"update"+"&id="+p.getKey().getId();
                        String strDelete = "<a href='"+delete+"'>delete</a>";
                        String strUpdate = "<a href='"+update+"'>update</a>";
                        String ancla = strDelete + " | " + strUpdate;
                    %>
                    <tr>
                        <td><%= p.getKey().getId()%></td>
                        <td><%= p.getProperty("nombre")%></td>
                        <td><%= p.getProperty("fecha")%></td>
                        <td><%= p.getProperty("prioridad")%></td>
                        <td><%= p.getProperty("estado")%></td>
                        <td><%= p.getProperty("descripcion")%></td>
                        <td><a href="/requerimiento?action=getAll" class="btn btn-success" title="Nuevo Requemiento">Detalle <img width="15" height="15" src="../images/find.png" /></a></td>
                    </tr>
                    <%
                    }
                    %>
                </tbody>
            </table>
        </div>
        </div>
        </div>
    </body>
</html>
